#include "BubbleSorter.hpp"

BubbleSorter::BubbleSorter() {
}

BubbleSorter::BubbleSorter(const BubbleSorter& orig) {
}

BubbleSorter::~BubbleSorter() {
}

void BubbleSorter::sort(OwnCollections::ArrayList<int>& vector) {
    int count = vector.getCount();
    if (count < 2) {
        return;
    }

    for (int i = 0; i < count; i++) {
        for (int x = 0; x < count - 1 - i; x++) {
            if (vector[x] > vector[x + 1]) {
                vector.swap(x, x + 1);
            }
        }
    }
}

